/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jkoa.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "jenis_kerja")
@NamedQueries({
    @NamedQuery(name = "JenisKerja.findAll", query = "SELECT j FROM JenisKerja j")})
public class JenisKerja implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected JenisKerjaPK jenisKerjaPK;
    @Basic(optional = false)
    @Column(name = "nama")
    private String nama;
    @Basic(optional = false)
    @Column(name = "gaji")
    private String gaji;
    @Basic(optional = false)
    @Column(name = "dimasuk")
    private String dimasuk;
    @Basic(optional = false)
    @Column(name = "trh_masuk")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhMasuk;
    @Column(name = "dikkini")
    private String dikkini;
    @Column(name = "trh_kkini")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhKkini;

    public JenisKerja() {
    }

    public JenisKerja(JenisKerjaPK jenisKerjaPK) {
        this.jenisKerjaPK = jenisKerjaPK;
    }

    public JenisKerja(JenisKerjaPK jenisKerjaPK, String nama, String gaji, String dimasuk, Date trhMasuk) {
        this.jenisKerjaPK = jenisKerjaPK;
        this.nama = nama;
        this.gaji = gaji;
        this.dimasuk = dimasuk;
        this.trhMasuk = trhMasuk;
    }

    public JenisKerja(int idJenisKerja, int idMajikan) {
        this.jenisKerjaPK = new JenisKerjaPK(idJenisKerja, idMajikan);
    }

    public JenisKerjaPK getJenisKerjaPK() {
        return jenisKerjaPK;
    }

    public void setJenisKerjaPK(JenisKerjaPK jenisKerjaPK) {
        this.jenisKerjaPK = jenisKerjaPK;
    }

    public String getNama() {
        return nama;
    }

    public void setNama(String nama) {
        this.nama = nama;
    }

    public String getGaji() {
        return gaji;
    }

    public void setGaji(String gaji) {
        this.gaji = gaji;
    }

    public String getDimasuk() {
        return dimasuk;
    }

    public void setDimasuk(String dimasuk) {
        this.dimasuk = dimasuk;
    }

    public Date getTrhMasuk() {
        return trhMasuk;
    }

    public void setTrhMasuk(Date trhMasuk) {
        this.trhMasuk = trhMasuk;
    }

    public String getDikkini() {
        return dikkini;
    }

    public void setDikkini(String dikkini) {
        this.dikkini = dikkini;
    }

    public Date getTrhKkini() {
        return trhKkini;
    }

    public void setTrhKkini(Date trhKkini) {
        this.trhKkini = trhKkini;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (jenisKerjaPK != null ? jenisKerjaPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof JenisKerja)) {
            return false;
        }
        JenisKerja other = (JenisKerja) object;
        if ((this.jenisKerjaPK == null && other.jenisKerjaPK != null) || (this.jenisKerjaPK != null && !this.jenisKerjaPK.equals(other.jenisKerjaPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jkoa.model.JenisKerja[ jenisKerjaPK=" + jenisKerjaPK + " ]";
    }
    
}
